package com.example.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.example.domain.Role;

/**
 * @author 袁小弘
 * @describe 角色DAO层
 * @date 2019-12-31
 */
@Repository
public interface RoleDao extends JpaRepository<Role, Integer> {

    @Transactional
    @Modifying
    int deleteByRoleId(Integer roleId);

    List<Role> findByRoleId(Integer roleId);

    @Transactional
    @Modifying
    int deleteByRoleIdIn(List<Integer> listId);

    List<Role> findByRoleNameLike(String string);

}
